#ifndef qbe_select_hpp
#define qbe_select_hpp

#include <qlib/all.h>
#include <KDTree/KDTree.hpp>
#include <entt/entt.hpp>

#include "../render/render.hpp"
#include "../state/state.hpp"

#include "./components.hpp"
#include "./events.hpp"
#include "./models.hpp"
// #include "./select_cmd.hpp"

#include "./overall.hpp"

namespace qbe::select {

class PreUpdateStage : public ecs::stage::after<ecs::stage::PreUpdate> {};
class OverallUpdateStage : public ecs::stage::after<ecs::stage::PreUpdate> {};
class PartUpdateStage : public ecs::stage::after<OverallUpdateStage> {};

enum struct SelectState : uint8_t {
  None,
  Update,
  Render,
  Clear,
};

struct SelectPartArgs {
  bool hover{false};
};

struct SelectOne {
  bool press{false};
  bool release{false};
  bool move{false};
};

struct SelectBoxRect {
  double x, y, w, h;
};
struct SelectBox {};

class SelectPlugin : public ecs::Plugin {
 public:
  void build(ecs::App& app) override;
};

}  // namespace qbe::select

#endif